package com.xwn.demo;

import org.apache.commons.lang3.StringUtils;

public class StringDemo {
    public static void main(String[] args) {
        String str = "(0:200)(1:100)";
        String [] strArr = StringUtils.split(str,"()");
        for (String s : strArr) {
            System.out.println(s);
        }

        String sex = "0";
        String ageString = null;
        if(strArr.length==1){
            ageString = strArr[0].substring(0,1).equals(sex)?strArr[0].substring(2):"";
        }else {
            ageString = "0".equals(sex)?strArr[0].substring(2):strArr[1].substring(2);
        }
        System.out.println(ageString);
    }
}
